<template>
	<!-- 1转让2出租哟一个页面 -->
	<view class="content">
		<u-navbar :is-back='true' title="发布帖子" :border-bottom='true' />
		<view class="carp">
			<view class="text">信息标题
			</view>
			：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入信息标题" placeholder-class='placeholderStyle' />
			</view>
		</view>
		<view class="carp">
			<view class="text">类别
			</view>：
			<view style="width:76%;">
				<xfl-select :list="
					[
						'苹果',
						{
							value: '香蕉',
							disabled: false,
							id:50
						},
						'葡萄',
						'芒果',
						'大白菜',
				]" :clearable="false" :showItemNum="5" :listShow="false" :isCanInput="false" :style_Container="styles"
					@change='inputclick' placeholder="请选择类别" :selectHideType="'hideAll'" />
			</view>
		</view>
		<view class="carp">
			<view class="text">类别细分
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请选择类别细分" placeholder-class='placeholderStyle' />
				<u-icon color="#999999" size="28" name="arrow-down" />
			</view>
		</view>
		<view class="carp">
			<view class="text">区域
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请选择区域" placeholder-class='placeholderStyle' />
				<u-icon color="#999999" size="28" name="arrow-down" />
			</view>
		</view>
		<view class="carp">
			<view class="text">商圈
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请选择商圈" placeholder-class='placeholderStyle' />
				<u-icon color="#999999" size="28" name="arrow-down" />
			</view>
		</view>
		<view class="carp">
			<view class="text">位置
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入位置" placeholder-class='placeholderStyle' />
				<image src="@/static/img/zb.png" style="width: 31rpx;height: 46rpx;" />
			</view>
		</view>
		<view class="carp">
			<view class="text">价格
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入金额" placeholder-class='placeholderStyle' />
				<text style="font-size: 32rpx;
font-family: Adobe Heiti Std;
font-weight: normal;
color: #999999;">元/月</text>
			</view>
		</view>

		<view class="carp" v-if="type==1">
			<view class="text">转让费
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入金额" placeholder-class='placeholderStyle' />
				<text style="font-size: 32rpx;
		font-family: Adobe Heiti Std;
		font-weight: normal;
		color: #999999;">元</text>
			</view>
		</view>
		<view class="carp" v-if="type==2">
			<view class="text">免租期
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入金额" placeholder-class='placeholderStyle' />
				<text style="font-size: 32rpx;
		font-family: Adobe Heiti Std;
		font-weight: normal;
		color: #999999;">元</text>
			</view>
		</view>
		<view class="carp">
			<view class="text">内容详情
			</view>：
			<view style="width: 76%;">
				<u-input v-model="value" type="textarea" :border="true" auto-height placeholder="请输入内容.." />
			</view>
		</view>
		<view class="carp">
			<view class="text">联系人
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入联系人" placeholder-class='placeholderStyle' />
			</view>
		</view>
		<view class="carp">
			<view class="text">联系电话
			</view>：
			<view class="carp_1">
				<input type="text" value="" placeholder="请输入联系电话" placeholder-class='placeholderStyle' />
			</view>
		</view>
		<view class="carp">
			<view class="text">上传图片
			</view>：
			<view class="radio">
				<view style="display: flex;flex-wrap: wrap;justify-content: space-around;">
					<u-upload :show-upload-list="false" :custom-btn="true">
						<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
							<image src="../../static/img/sc.png" />
							<text>上传</text>
						</view>
					</u-upload>
					<view class="img" v-for="(item,index) in 2">
						<image class="image1"
							src="http://puputong.huijipin.cn/uploads/20220307/ec05dc3a70b18d52b9eaccc83c80cce8.jpg" />
						<u-icon @click="sc(item)" name='close-circle-fill' class="icon" size="40" color='#FF1B1B'>
						</u-icon>
					</view>
				</view>
			</view>
		</view>
		<view class="foot" @click="submit">
			发布设备
		</view>
		<select-package  ref='child' />
		<!-- <pay-ment ref='child' /> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				type: 1,
				list: [{
						name: '客梯',
						checked: false,
						disabled: false
					},
					{
						name: '货梯',
						checked: false,
						disabled: false
					},
					{
						name: '空调',
						checked: false,
						disabled: false
					},
					{
						name: '扶梯',
						checked: false,
						disabled: false
					},
					{
						name: '天然气',
						checked: false,
						disabled: false
					}

				],
				styles: 'height: 80rpx;background: #FFFFFF;border: 1px solid #E1E1E1;border-radius: 10rpx'
			};
		},
		onLoad(e) {
			this.type = e.type
		},
		methods: {
			// 删除照片
			sc(a) {
				uni.showModal({
					title: '提示',
					content: '确定要删除这个图片?',
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			//发布
			submit() {
				this.$refs.child.sign()
			},
			inputclick(a, b) {
				console.log(a, b)
			},
			// 选中某个复选框时，由checkbox时触发
			checkboxChange(e) {
				console.log(e);
			},
			// 选中任一checkbox时，由checkbox-group触发
			checkboxGroupChange(e) {
				console.log(e);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding-bottom: 100rpx;

		.foot {
			width: 91%;
			position: fixed;
			bottom: 20rpx;
			height: 80rpx;
			background: #FF1B1B;
			border-radius: 40rpx;
			text-align: center;
			left: 50%;
			transform: translateX(-50%);
			line-height: 80rpx;
			font-size: 30rpx;
			font-family: OPPOSans;
			font-weight: 500;
			color: #FFFFFF;

		}

		/deep/ .placeholderStyle {
			font-size: 26rpx;
			font-family: OPPOSans;
			font-weight: 400;
		}

		.carp {
			display: flex;
			padding: 0rpx 25rpx 30rpx 25rpx;
			align-items: center;

			.radio_1 {
				display: flex;
				flex-wrap: wrap;
			}

			.radio {
				width: 76%;

				.img {
					width: 160rpx;
					height: 160rpx;
					border-radius: 8rpx;
					margin-bottom: 10rpx;
					position: relative;

					.icon {
						position: absolute;
						top: 0;
						right: 0;
					}

					.image1 {
						width: 100%;
						height: 100%;
						border-radius: 8rpx;
					}
				}

				.slot-btn {
					box-sizing: border-box;
					width: 160rpx;
					height: 160rpx;
					background: #FFFFFF;
					border: 1px solid #E1E1E1;
					border-radius: 10rpx;
					text-align: center;
					position: relative;

					image {
						width: 47rpx;
						margin-top: 30rpx;
						height: 42rpx;
					}

					text {
						width: 100%;
						height: 52rpx;
						position: absolute;
						line-height: 52rpx;
						bottom: 0rpx;
						background: #BFBFBF;
						display: block;
						font-size: 26rpx;
						font-family: OPPOSans;
						font-weight: 400;
						color: #FFFFFF;
					}
				}
			}

			.text {
				font-size: 30rpx;
				font-family: OPPOSans;
				font-weight: 500;
				color: #333333;
				display: block;
				width: 18%;
				text-align: justify;
				text-align-last: justify;
				position: relative;
				top: 20rpx;
				
				&:after {
					content: '';
					width: 100%;
					display: inline-block;
				}
			}

			.carp_1 {
				padding: 0 20rpx 0 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 70%;
				height: 80rpx;
				background: #FFFFFF;
				border: 1px solid #E1E1E1;
				border-radius: 10rpx;
			}

			.carp_2 {
				width: 70%;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.carp_2_t2 {
					font-size: 32rpx;
					font-family: Adobe Heiti Std;
					font-weight: normal;
					color: #999999;
				}

				.carp_2_t1 {
					width: 29rpx;
					height: 2rpx;
					background: #E1E1E1;
				}

				input {
					box-sizing: border-box;
					width: 180rpx;
					height: 80rpx;
					background: #FFFFFF;
					border: 1px solid #E1E1E1;
					padding-left: 20rpx;
					padding-right: 20rpx;
					border-radius: 10px
				}
			}
		}
	}
</style>
